package com.jy.api.payReq;

import com.jy.api.domain.Order;
import com.jy.api.domain.StorePay;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SaoBeiRefundPayReq {


    private String pay_ver="100";//版本号

    private String pay_type="000";//请求类型

    private String service_id="030";//接口类型

    private String merchant_no;//商户号

    private String terminal_id;//终端号

    private String terminal_trace;//终端流水号

    private String terminal_time;//终端交易时间

    private String refund_fee;//退款金额

    private String out_trade_no;

    private String total_fee;//金额

    private String key_sign; //签名检验串

    private String pay_trace;

    private String pay_time;


    public SaoBeiRefundPayReq(Order order, StorePay storePay) {
        this.merchant_no = storePay.getMchId();
        this.terminal_id = storePay.getTerminalId();
        this.terminal_trace = order.getCode();
        this.refund_fee = String.valueOf((int) Math.rint(order.getAmount() * 100));
        this.pay_trace=order.getId();
        this.out_trade_no="";
    }

}
